package com.che.software.testato.domain.entity;

import java.io.Serializable;

/**
 * Class representing an activity parameter.
 * 
 * @author Clement HELIOU (clement.heliou@che-software.com).
 * @copyright Che Software.
 * @license GNU General Public License.
 * @see Serializable
 * @since July, 2011.
 * 
 *        This file is part of Testato.
 * 
 *        Testato is free software: you can redistribute it and/or modify it
 *        under the terms of the GNU General Public License as published by the
 *        Free Software Foundation, either version 3 of the License, or (at your
 *        option) any later version.
 * 
 *        Testato is distributed in the hope that it will be useful, but WITHOUT
 *        ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 *        FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
 *        for more details.
 * 
 *        You should have received a copy of the GNU General Public License
 *        along with Testato. If not, see <http://www.gnu.org/licenses/>.
 * 
 *        Testato's logo is a creation of Arrioch
 *        (http://arrioch.deviantart.com/) and it's distributed under the terms
 *        of the Creative Commons License.
 */
public class ActivityParameter implements Serializable {

	/**
	 * Constants.
	 */
	private static final long serialVersionUID = -4979833513889495800L;

	/**
	 * Members.
	 */
	private int activityParameterId, activityId;
	private String description, name;

	/**
	 * Getter for the private field value activityParameterId.
	 * 
	 * @return the activityParameterId field value.
	 */
	public int getActivityParameterId() {
		return activityParameterId;
	}

	/**
	 * Setting a value to the activityParameterId field.
	 * 
	 * @param activityParameterId the value to set.
	 */
	public void setActivityParameterId(int activityParameterId) {
		this.activityParameterId = activityParameterId;
	}

	/**
	 * Getter for the private field value activityId.
	 * 
	 * @return the activityId field value.
	 */
	public int getActivityId() {
		return activityId;
	}

	/**
	 * Setting a value to the activityId field.
	 * 
	 * @param activityId the value to set.
	 */
	public void setActivityId(int activityId) {
		this.activityId = activityId;
	}

	/**
	 * Getter for the private field value description.
	 * 
	 * @return the description field value.
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * Setting a value to the description field.
	 * 
	 * @param description the value to set.
	 */
	public void setDescription(String description) {
		this.description = description;
	}

	/**
	 * Getter for the private field value name.
	 * 
	 * @return the name field value.
	 */
	public String getName() {
		return name;
	}

	/**
	 * Setting a value to the name field.
	 * 
	 * @param name the value to set.
	 */
	public void setName(String name) {
		this.name = name;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + activityId;
		result = prime * result + activityParameterId;
		result = prime * result + ((description == null) ? 0 : description.hashCode());
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		return result;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ActivityParameter other = (ActivityParameter) obj;
		if (activityId != other.activityId)
			return false;
		if (activityParameterId != other.activityParameterId)
			return false;
		if (description == null) {
			if (other.description != null)
				return false;
		} else if (!description.equals(other.description))
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		return true;
	}
}